import { defHttp } from '/@/utils/http/axios';
import {
  articleDetailApiParams,
  saveArticleDetailApiParams,
  editArticleDetailApiParams,
} from './model/articleDetailModel';

enum Api {
  GetArticleDetail = '/article/getById',
  GetSaveArticleDetail = '/article/saveArticle',
  GetEditArticleDetail = '/article/update',
}

/**
 * @description: Get user menu based on id
 */

export const getArticleDetail = (params: articleDetailApiParams) => {
  return defHttp.get({ url: Api.GetArticleDetail, params });
};
export const getSaveArticleDetail = (params: saveArticleDetailApiParams) => {
  return defHttp.post({ url: Api.GetSaveArticleDetail, params });
};
export const getEditArticleDetail = (params: editArticleDetailApiParams) => {
  return defHttp.put({ url: Api.GetEditArticleDetail, params });
};
